home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / c01oop.zip / CPPWKBK / CPPV2-6.CPP < prev    next >
C/C++ Source or Header  |  1992-08-25  |  553b  |  27 lines

  1. #define HEADER "C++ Problem 2.6 by Rick Conn using Borland C++"
  2.  
  3. #include <stdio.h>
  4.  
  5. struct book {
  6.   char title[40];
  7.   char author[20];
  8. };
  9.  
  10. void print_book (book &name)
  11. {
  12.   printf(" Title: %s\n", name.title);
  13.   printf("Author: %s\n", name.author);
  14. }
  15.  
  16. void main(void)
  17. {
  18.   printf("%s\n", HEADER);
  19.  
  20.   book textbook = { "Turbo C++ DiskTutor",
  21.                     "Voss & Chui" };
  22.   book refbook = { "The Annotated C++ Reference Manual",
  23.                    "Ellis & Stroustrup" };
  24.   print_book (textbook);
  25.   print_book (refbook);
  26. }
  27.